#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string>

using namespace std;

int main(int argc, char **argv)
{
	string p1p2test("nachos -x ");
	string p3test("nachos -x ../test/doctorOffice -rs ");	// if you need an input stream...
	string p4test("nachos -x ../test/twoDoctorOffice -rs ");
	string TwoOfficeTest;
	int error;
	int cmd;
	int rs;
	string tmp;
	bool quit = false;
	while (!quit) {
		printf("1. Lock & CV Test \n");
		printf("2. Fork & Exec Test \n");
		printf("3. Single Doctor's Office\n");
		printf("4. Two Doctor's Office\n");
		printf("5. quit\n");
		printf("Please enter the number 1-5 corresponding to above options: ");
		cin >> cmd;
		string call = "";
		switch (cmd) {
			case 1:
				call = p1p2test + "../test/lock_CV_test";
				error = system(call.data());
				break;
			case 2:
				call = p1p2test + "../test/fork_exec_test";
				error = system(call.data());
				break;
			case 3:
				printf("Please enter the rs number: ");
				cin >> tmp;
				call = p3test + tmp;
				error = system(call.data());
				break;
			case 4:
				printf("Please enter the rs number: ");
				cin >> tmp;
				call = p4test + tmp;
				error = system(call.data());
				break;
			case 5:
				quit = true;
				break;
			default:
				printf("There is no such command\n");
				break;
		}
	}
	return error;
}
